﻿<%@ Page Title="" Language="C#" MasterPageFile="~/InputCtrl.Master" AutoEventWireup="true" CodeBehind="CompareValidator.aspx.cs" Inherits="LiveDemo.InputCtrl.CompareValidator" %>
<%@ Register
    Assembly="AjaxControlToolkit"
    Namespace="AjaxControlToolkit"
    TagPrefix="AjaxToolkit" %>
<%@ Register assembly="System.Web.Silverlight" namespace="System.Web.UI.SilverlightControls" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function onSourceDownloadProgressChanged(sender, eventArgs) {
            var value = 0;
            if (eventArgs.progress) {
                value = eventArgs.progress;
            }
            else {
                value = eventArgs.get_progress();
            }
            sender.get_element().content.findName("progressBar").Width = value * sender.get_element().content.findName("progressBarBackground").Width;
        }
    </script> 
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="logo_SlInputCtrl"></div>
    <div class="heading">
        CompareValidator Demonstration
    </div>
    <div style="height:500px;width:540px">
        <asp:Silverlight ID="Silverlight1" 
                runat="server" 
                Source="~/ClientBin/CompareValidatorDemo.xap" MinimumVersion="2.0.31005.0" 
                Windowless="true"
                OnPluginSourceDownloadProgressChanged ="onSourceDownloadProgressChanged"
                SplashScreenSource="SplashValidators.xaml"
                InitParameters="Culture=en-US,UICulture=en-US"
                Height="100%" 
                Width="100%">
        </asp:Silverlight>
    </div>
    <asp:Panel ID="properties_HeaderPanel" runat="server" Style="cursor: pointer;">
        <div class="heading">
            <asp:ImageButton ID="Properties_ToggleImage" runat="server" ImageUrl="~/images/expand.jpg" AlternateText="expand"  />
            Dependency Properties
        </div>
    </asp:Panel>
    <asp:Panel ID="properties_ContentPanel" runat="server" Style="overflow: hidden;" Height="0px">
        <p>
            <span class="subheading">
            CultureInput:
            </span>
            CultureInfo to compare values. Default value is thread culture Current.
        </p>
        <p>
            <span class="subheading">
            DataType:
            </span>
            Data type to compare.
        </p>
        <ul>
            <li>
                String
            </li>
            <li>
                Integer
            </li>
            <li>
                Double
            </li>
            <li>
                Date
            </li>
            <li>
                Time
            </li>
        </ul>
        <p>
            <span class="subheading">
            TimeType:
            </span>
            Time type to compare when DataType is <b>Time</b>.
        </p>
        <ul>
            <li>
                Hours12: Min. 0 and Max. 12.
            </li>
            <li>
                Hours24: Min. 0 and Max. 23.
            </li>
        </ul>
        <p>
            <span class="subheading">
            ValueToCompare:
            </span>
            The constant value to compare with the value entered by the user in the input control being validated. 
        </p>
        <p>
            <span class="subheading">
            ControlToCompare:
            </span>
            The input control to compare with the input control being validated. 
        </p>
        <p>
            <span class="subheading">
            PropertyControlToCompare:
            </span>
            The property name of control to compare.If empty, <b>Only TextBox, TextBlock and PasswordBox </b>Controls are valids. The value of property is converted to string.
        </p>
        <p>
            <span class="subheading">
            Operator:
            </span>
            the comparison operation to perform.
        </p>
        <ul>
            <li>
                <b>Equal</b>: A comparison for equality between the values of the input control being validated and another control, or a constant value. 
            </li>
            <li>
                <b>NotEqual</b>: A comparison for inequality between the values of the input control being validated and another control, or a constant value.
            </li>
            <li>
                <b>GreaterThan</b>: A comparison for greater than between the values of the input control being validated and another control, or a constant value.
            </li>
            <li>
                <b>GreaterThanEqual</b>: A comparison for greater than or equal to between the values of the input control being validated and another control, or a constant value.
            </li>
            <li>
                <b>LessThan</b>: A comparison for less than between the values of the input control being validated and another control, or a constant value.
            </li>
            <li>
                <b>LessThanEqual</b>: A comparison for less than between the values of the input control being validated and another control, or a constant value.
            </li>
            <li>
                <b>DataTypeCheck</b>: A data type comparison of the value entered in the input control being validated and the data type specified. Validation fails if the value cannot be converted to the specified data type. <b>Note</b>: The ControlToCompare and ValueToCompare properties are ignored when this operator is used.
            </li>
        </ul>

        
    </asp:Panel>

    <ajaxToolkit:CollapsiblePanelExtender ID="cpeProperties" runat="Server"
        TargetControlID="properties_ContentPanel"
        ExpandControlID="properties_HeaderPanel"
        CollapseControlID="properties_HeaderPanel"
        SuppressPostBack ="true"
        CollapsedImage ="~/Images/expand.jpg"
        ExpandedImage ="~/Images/collapse.jpg"
        Collapsed="True"
        ImageControlID="properties_ToggleImage" />
</asp:Content>
